Skip to content

Conversation

@coffee-mug
Copy link
Contributor

@coffee-mug coffee-mug commented Mar 21, 2025

…ppeteer does not try to call fs to store images

Summary

closes #20984 for Browser Rendering documentation example.

The example shows how to take a screenshot with puppeteer from a worker and save the image in R2. In this example, the call to page.screenshot failed due to fs not being available in Cloudflare Workers.

Removing the "path" parameter from the call to page.screenshot fixed the issue, because puppeteer just passes the bytes array instead of trying to save the file locally.

Screenshots (optional)

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

@coffee-mug coffee-mug requested review from a team, celso, danielgek and mchenco as code owners March 21, 2025 15:18
@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented Mar 21, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Fixed issue with screenshot functionality in Browser Rendering documentation for Cloudflare Workers.

  • Updated the screenshot example to remove the path parameter in Puppeteer.
  • Ensured compatibility with Cloudflare Workers by avoiding local file storage.
  • Clarified the process of saving screenshots in R2.

Modified Files

  • src/content/docs/browser-rendering/workers-binding-api/browser-rendering-with-DO.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

What is Hyperlint?

Hyperlint is an AI agent that helps you write, edit, and maintain your documentation.

Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation.

@kodster28 kodster28 merged commit 103e37b into cloudflare:production Mar 21, 2025
7 checks passed
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes a docs contribution, big or small label Mar 21, 2025
@holopin-bot
Copy link

holopin-bot bot commented Mar 21, 2025

Congratulations @coffee-mug, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cm8j4onr449380cl1mc5qlylk

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

RebeccaTamachiro pushed a commit that referenced this pull request Apr 21, 2025
* Fix - #20984 - removed path parameter from page.screenshot call so puppeteer does not try to call fs to store images

* Fix: removed change to first sentence

---------

Co-authored-by: Lucas Kostka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution [Holopin] Recognizes a docs contribution, big or small product:browser-rendering size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "Deploy a Browser Rendering Worker with Durable Objects" sample code doesn't work.

8 participants